package com.cj.demo.job;

import com.cj.demo.config.XxlJobConfig;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.JobHandler;
import com.xxl.job.core.log.XxlJobLogger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@JobHandler(value = "DemoJobHandler2_Autowired")
@Component
public class DemoJobHandler2_Autowired extends IJobHandler {

    @Autowired
    private XxlJobConfig xxlJobConfig;

    @Override
    public ReturnT<String> execute(String param) throws Exception {
        XxlJobLogger.log("=============DemoJobHandler_Autowired============");
        XxlJobLogger.log(xxlJobConfig.method());
        XxlJobLogger.log("=============DemoJobHandler_Autowired============");
        return SUCCESS;
    }

}